<template>
  <div>
    <div class="nav">
      <div class="fontStyle" @click="backFun">
        <i class="el-icon-arrow-left m-r-10"></i>返回
      </div>
      <div class="tabs">
        <div
          :class="index === i ? 'selected' : 'normalStyle'"
          v-for="(item, i) in tabs"
          :key="i"
          @click="select(i)"
        >
          {{ item }}
        </div>
      </div>
      <div class="operation">
        <div class="export m-r"><span class="word">导出统计结果</span></div>
        <!-- <ScreenFull ref="full" /> -->
      </div>
    </div>
    <div class="pos"></div>
  </div>
</template>

<script>
export default {
  name: "Navbar",
  data() {
    return {
      index: 0,
      tabs: ["共享资源", "共享服务", "信息使用", "用户访问"],
    };
  },
  methods: {
    select(i) {
      this.index = i;
      this.$emit("select", i);
    },
    backFun() {
      this.$router.go(-1);
    },
  },
};
</script>

<style lang="less" scoped>
.export {
  margin-top: 20px;
  display: inline-block;
  background: url("~@/assets/img/buttonBack.png");
  background-size: cover;
  width: 196px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.word {
  font-weight: 500;
  font-size: 18px;
  text-align: left;
  font-style: normal;
  background-image: linear-gradient(
    to bottom,
    #ffffff,
    #aef4ff
  ); // 背景线性渐变
  color: #ffffff; // 兜底颜色，防止文字裁剪不生效
  background-clip: text;
  -webkit-background-clip: text; // 背景被裁减为文字的前景色
  -webkit-text-fill-color: transparent; // 文字填充为透明，优先级比color高。
}
.nav {
  box-sizing: border-box;
  height: 90px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: url("~@/assets/img/navback.png");
  background-size: cover;
  position: absolute;
  top: -18px;
  padding: 20px 20px;
  .tabs {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    // display: flex;
    // background: linear-gradient(180deg, #040e2d 0%, #0e1839 100%);
    // div {
    //   border-left: 1px solid #fff;
    //   border-right: 1px solid #fff;
    //   cursor: pointer;
    //   width: 120px;
    //   line-height: 50px;
    //   text-align: center;
    //   color: #fff;
    //   &:nth-of-type(1) {
    //     border-left-style: none;
    //   }
    //   &:nth-of-type(4) {
    //     border-right-style: none;
    //   }
    // }
  }
  .operation {
    display: flex;
    align-items: center;
    button {
      width: 100px;
      height: 35px;
      background-color: #169bd5;
      color: #fff;
      border-style: none;
      border-radius: 5px;
      font-size: 12px;
    }
  }
}

// 选中特效
.selected {
  cursor: pointer;
  display: inline-block;
  padding: 0 30px;
  font-family: SourceHanSansCN, SourceHanSansCN;
  font-weight: bold;
  font-size: 24px;
  color: #dbf2ff;
  line-height: 42px;
  text-shadow: 0px 0px 8px #5eb1ff;
  text-align: left;
  font-style: normal;
}
.fontStyle {
  cursor: pointer;
  font-weight: bold;
  font-size: 20px;
  background-image: linear-gradient(
    to bottom,
    #6292c8,
    #dbf2ff
  ); // 背景线性渐变
  color: #ffffff; // 兜底颜色，防止文字裁剪不生效
  background-clip: text;
  -webkit-background-clip: text; // 背景被裁减为文字的前景色
  -webkit-text-fill-color: transparent; // 文字填充为透明，优先级比color高。
}
.normalStyle {
  cursor: pointer;
  display: inline-block;
  padding: 0 30px;
  text-align: center;
  font-weight: bold;
  font-size: 20px;
  background-image: linear-gradient(
    to bottom,
    #6292c8,
    #dbf2ff
  ); // 背景线性渐变
  color: #ffffff; // 兜底颜色，防止文字裁剪不生效
  background-clip: text;
  -webkit-background-clip: text; // 背景被裁减为文字的前景色
  -webkit-text-fill-color: transparent; // 文字填充为透明，优先级比color高。
}
.pos {
  height: 40px;
}
</style>
